/**
 * Created by IntelliJ IDEA.
 * User: Bezdelnick
 * Date: 9/26/12
 * Time: 8:06 PM
 * To change this template use File | Settings | File Templates.
 */
package vplib.component {
import alternativa.engine3d.core.Object3D;

import alternativa.engine3d.materials.FillMaterial;
import alternativa.engine3d.primitives.GeoSphere;

import vplib.dictionary.PropertiesDictionary;
import vplib.model.AbstractPhysicsModel;
import vplib.model.MaterialPointModel;

public class MaterialPointComponent extends AbstractPhysicsComponent {

    public function MaterialPointComponent(uniqueId:String) {
        super(uniqueId);

        _surface = new GeoSphere(10, 10);
        _surface.setMaterialToAllSurfaces(new FillMaterial(0xff0000));

        _model = new MaterialPointModel()
    }

    override public function applyModelToSurface():void {
        //super.applyModelToSurface();

        _surface.x = Number(_model.getPropertyByName(PropertiesDictionary.get_COORDINATE_X().name).value);
        _surface.y = Number(_model.getPropertyByName(PropertiesDictionary.get_COORDINATE_Y().name).value);
        _surface.z = Number(_model.getPropertyByName(PropertiesDictionary.get_COORDINATE_Z().name).value);
    }
}
}
